package com.findMoneyGame.models {
	import flash.events.EventDispatcher;
	import flash.events.Event;

	public class Model extends EventDispatcher {
		public static var UPDATE : String = "update";
		public static var DATA_SAVED : String = "dataSaved";
		public static var DATA_SAVING_ERROR : String = "dataSavingError";

		private var _id : int;
		public function get id () : int { return _id; }
		public function set id (value : int) { _id = value; }

		public function Model (id : int = -1) { this._id = id; }


		protected function dispatchUpdate () {
			dispatchStrEvent(UPDATE);
			//
		}
		protected function dispatchDataSaved () {
			dispatchStrEvent(DATA_SAVED);
			//
		}
		protected function dispatchDataSavingError () {
			dispatchStrEvent(DATA_SAVING_ERROR);
			//
		}
		protected function dispatchStrEvent (event : String) {
			dispatchEvent(new Event(event));
			//
		}
	}
}